package com.example.demo.controller;

import com.example.demo.utils.ReadFileUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/file")
@Api(tags = "文件接口")
public class FileController {
    @GetMapping("/getFiles")
    @ApiOperation("获取目标文件夹下的所有文件名")
    public List<String> getFiles(String path){
        return ReadFileUtils.getAllFileName(path);
    }
}
